<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Document</title>
  </head>
  <body>
    <script>
      var num = prompt('请输入数字');
      var res = (num < 10 && '小于10') || (num > 10 && '大于10') || '等于10';
      alert(res);
    </script>
  </body>
</html>